//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package test.test.计算活了多少天;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;

public class demo {
    public demo() {
    }

    public static void main(String[] args) {
        System.out.println(aliveDayJdk7());
        System.out.println(aliveDayJdk8());
    }

    public static int aliveDayJdk7() {
        Calendar birthday = Calendar.getInstance();
        birthday.set(2003, 6, 18, 0, 0, 0);
        return (int)((System.currentTimeMillis() - birthday.getTimeInMillis()) / 86400000L);
    }

    public static int aliveDayJdk8() {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime birthday = LocalDateTime.of(2003, 7, 18, 0, 0, 0);
        return (int)ChronoUnit.DAYS.between(birthday, now);
    }
}
